package com.moon.feign;

import com.moon.dto.TUser;
import com.moon.dto.TUserVo;
import com.sun.xml.internal.messaging.saaj.packaging.mime.MessagingException;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.security.NoSuchAlgorithmException;
import java.util.Map;
import java.util.Objects;

@FeignClient(name = "moon-service-login")
public interface UserFeign {
    @RequestMapping("/user/login")
    Map<String, Object> login(TUser user) throws NoSuchAlgorithmException;
    @RequestMapping("/user/register")
    String register(@RequestBody TUserVo tUserVo) throws NoSuchAlgorithmException;

    @RequestMapping("/user/findPasswordSendEmail")
    String findPasswordSendEmail(@RequestBody TUserVo tUserVo) throws NoSuchAlgorithmException;

    @RequestMapping("/user/sendEmail")
    String sendEmail(@RequestParam("to") String to, @RequestParam("subject") String subject,HttpServletRequest request) throws MessagingException;

}
